03. Java Basic APIs - String

035ND C01 L01 A01 MATH, DATE, STRING

Java math, date, string and character are really basic yet useful java APIs.
You should expect to see lots of these in this class. If you are coming from different programming language, you should be OK to learn them quickly.
In this class, I am not going to teach them one by one, please take a look at the API documents yourself. And you should have no problem to complete the quizzes or the coding exercises.

Resources:

Math: https://docs.oracle.com/javase/8/docs/api/java/lang/Math.html

Date: https://docs.oracle.com/javase/8/docs/api/java/util/Date.html

String: https://docs.oracle.com/javase/8/docs/api/java/lang/String.html

Character: https://docs.oracle.com/javase/8/docs/api/java/lang/Character.html

Here some quizzes to get us up to speed!

Math, Date, String, Character Quiz 1

Which of the following Java statement will produce 8.0?

SOLUTION: Math.abs(-8.0)

Math, Date, String, Character Quiz 2

Given a > b, b > c, which statement will return the a?

SOLUTION: Math.max(c, Math.abs(Math.min(-a, -b)))

Math, Date, String, Character Quiz 3

Convert 1561554154352 to UTC time you would get what date and time?

SOLUTION: Wed Jun 26 2019 13:02:34

Math, Date, String, Character Quiz 4

String in Java is a?

SOLUTION: class

Math, Date, String, Character Quiz5

Which statement below will NOT produce a char ‘a’ ?

SOLUTION: Character.toString(‘a’)